package com.ita.servlet.view;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ita.dao.WareHouseDao;
import com.ita.dao.impl.WareHouseDaoImpl;
import com.ita.pojo.WareHouse;

public class ShowAddGoodsServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	private WareHouseDao whd;

	public ShowAddGoodsServlet() {
		whd = new WareHouseDaoImpl();
	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		List<WareHouse> list = whd.findAll();
		request.getSession().setAttribute("wares", list);
		request.getRequestDispatcher("addgoods.jsp").forward(request, response);

	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
